import {getOrderList} from 'api/api';
export default{
    state:{
      orderList:[]
    },
    mutations:{
        getOrderList(state,orderList){
            state.orderList=orderList
        }
    },
    actions:{
       async getOrderList(store,{page,limit}){
           try{
            const {code,data}=await getOrderList({page,limit})
            // console.log(code,data);
            if(code===200){ 
                store.commit('getOrderList',data.records)
            }
            return {code,data}
           }catch(e){
               return Promise.reject(e)
           }
       }
       
    },
    getters:{}
}